#!/bin/sh

export OUT_DIR=/home/willren/dev/arm/output/ffmpeg
export ANDROID_HOME=/Users/will/sdk/android-ndk-r6

export PREBUILT=$ANDROID_HOME/toolchains/arm-linux-androideabi-4.4.3/prebuilt/darwin-x86
export PLATFORM=$ANDROID_HOME/platforms/android-8/arch-arm
export ARM_INC=$PLATFORM/usr/include
export ARM_LIB=$PLATFORM/usr/lib
export ARM_LIB2=$PREBUILT/lib/gcc/arm-linux-androideabi/4.4.3
export ARM_CFLAGS="-I$ARM_INC -fPIC -DANDROID"
export ARM_LDFLAGS="-nostdlib -L$ARM_LIB2 -L$ARM_LIB -lc -lm -ldl -lz -lgcc"

./configure --target-os=linux --arch=arm --enable-static --enable-shared  \
	--disable-ffmpeg --disable-ffprobe --disable-ffserver --prefix=$OUT_DIR \
	--enable-cross-compile --cross-prefix=$PREBUILT/bin/arm-linux-androideabi- \
	--extra-cflags="$ARM_CFLAGS" --extra-ldflags="$ARM_LDFLAGS"
